import { NgModule, Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { ProjectGridComponent } from './project-grid/project-grid.component';
import { ProjectDetailComponent } from './project-detail/project-detail.component';
import { PropertyGridComponent } from './property-grid/property-grid.component';
import { SharedPropertyDetailComponent } from './property-detail/property-detail.component';
import { SalesRecordComponent } from './sales-record/sales-record.component';
import { PropertyManagementComponent } from './property-management/property-management.component';
import { CustomerPropertyManagementComponent } from './customer-property-management/customer-property-management.component';
import { CustomerPropertyListComponent } from './customer-property-list/customer-property-list.component';
import { SubagentKpiComponent } from './subagent-kpi/subagent-kpi.component';
import { SharedComponent } from './shared.component';
import { UserProfileComponent } from './user-profile/user-profile.component';
import { MapviewComponent } from './mapview/mapview.component';
import { SettingsComponent } from './settings/settings.component';
import { SaleNotificationComponent } from './sale-notification/sale-notification.component';


const routes: Routes = [
    {
        path: '',
        component: SharedComponent,
        children: [
            { 
                path: '', redirectTo: 'project-grid' 
            },
            {
                path: 'project-grid', component: ProjectGridComponent,
            },
            { 
                path: 'project-detail/:id', component: ProjectDetailComponent  
            },
            {
                path: 'property-grid', component: PropertyGridComponent,
            },
            { 
                path: 'property-detail/:id', component: SharedPropertyDetailComponent 
            },
            { 
                path: 'agent-sales-record/:user-id', component: SalesRecordComponent 
            },
            { 
                path: 'agent-property-management/:user-id', component: PropertyManagementComponent 
            },
            { 
                path: 'customer-property-grid/:user-id', component: CustomerPropertyListComponent 
            },
            { 
                path: 'customer-property-management-grid/:user-id', component: CustomerPropertyManagementComponent 
            },
            {
                path: 'membership/:referid', component: SubagentKpiComponent
            },
            {
                path: 'profile/:id', component: UserProfileComponent
            },
            {
                path: 'mapview', component: MapviewComponent
            },
            {
                path: 'sale-notification', component: SaleNotificationComponent
            },
            {
                path: 'settings', component: SettingsComponent
            }

        ]
    }
]

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class SharedPropertyRoutingModule { }
